#!/usr/bin/env node
 const fs=require('fs');
 const img_name=process.argv[2];
 fs.readFile(img_name,function(err,buf){
   if(err){
     console.error(err);
     process.exit(1)
   }
   if(buf.toString('ascll',0,2==='BM')){
     console.log('width:'buf.readInt32LE(0x12));
     console.log('height:'buf.readInt32LE(0x16));
     console.log('color depth:'buf.readUInt16LE(0x1c));
   };
   
 });

